from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField
from wtforms.validators import DataRequired, Length


class NewNoteForm(FlaskForm):
    """笔记的表单

    """
    body = TextAreaField('内容', validators=[DataRequired()])
    submit = SubmitField('保存')


class DeleteNoteForm(FlaskForm):
    """删除笔记的按钮

    """
    submit = SubmitField('删除')


class UpdateNoteForm(NewNoteForm):
    """更新笔记的按钮

    """
    submit = SubmitField('修改')

class LoginForm(FlaskForm):
    """登陆表单

    """
    name = StringField('用户名:')
    passwd = PasswordField('密码:')
    submit = SubmitField('登陆')
